package com.lagou.edu.servlet;

import com.lagou.edu.request.Request;
import com.lagou.edu.response.Response;
import com.lagou.edu.utils.HttpProtocolUtil;

import java.io.IOException;

/**
 * @author 赵虎
 * @date 2020/11/8 10:07 下午
 */
public class LagouServlet extends HttpServlet {
    @Override
    public void doGet(Request request, Response response) throws IOException {
        String content = "<h1>lagou2 Servlet get</h1>";
        response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
    }

    @Override
    public void doPost(Request request, Response response) throws IOException {
        String content = "<h1>lagou2 Servlet post</h1>";
        response.output(HttpProtocolUtil.getHttpHeader200(content.getBytes().length) + content);
    }

    @Override
    public void init() throws Exception {

    }

    @Override
    public void destroy() throws Exception {

    }
}
